package main

type ListNode struct {
	Val  int
	Next *ListNode
}

func hasCycle(node *ListNode) bool {
	if node == nil {
		return false
	}

	i, j := node, node
	for j.Next != nil && j.Next.Next != nil {
		i = i.Next
		j = j.Next.Next
		if i == j {
			return true
		}
	}
	return false
}

func main() {

}
